You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When doing testing on the USB workflow, I didn't see output from the code when using Save + Run button unless I was editing code.py (the code branches according to filename, restarting if code.py otherwise running in RAW mode).
This just outputs the fact import is being called, and the result being printed, then the standard "Code done running." in case there is no output from the code.
It's also worth noting that there is a 15second timeout default when calling runCode, so that might want to be raised to infinity or something to allow code to continue to run. Issue there is we wouldn't see the output until it finishes (or at least that's my assumption)
Tested with a file called c1.py, containing print(1), and another called 1.py (print helloworld2) which doesn't output anything due to the bad filename for importing (half expected an import error to be returned by runCode but it's an empty string).
In relation to this comment by Scott, #399 (comment), it maybe makes more sense to use supervisor.set_next_code_file (docs), with the users file path (maybe also setting working directory), and then do a supervisor.reload.
You still wouldn't get boot.py running first, and usb drive would be as initially configured, but it would be more like the user expected. I think probably not the sticky argument though, so errors are shown and break to repl (presumably ctrl-d wouldn't rerun their file and instead do reload and run code.py).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When doing testing on the USB workflow, I didn't see output from the code when using Save + Run button unless I was editing code.py (the code branches according to filename, restarting if code.py otherwise running in RAW mode).
This just outputs the fact import is being called, and the result being printed, then the standard "Code done running." in case there is no output from the code.
It's also worth noting that there is a 15second timeout default when calling runCode, so that might want to be raised to infinity or something to allow code to continue to run. Issue there is we wouldn't see the output until it finishes (or at least that's my assumption)